import { PageModalService } from 'src/app/shared/service/page-modal-service';
import { Component, Input, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { AppGlobalService } from 'src/app/shared/service/app-global.service';

@Component({
  selector: 'app-select-account-modal',
  templateUrl: './select-account-modal.component.html',
  styleUrls: ['./select-account-modal.component.scss'],
})
export class SelectAccountModalComponent implements OnInit {

  @Input() tagData: any;
  constructor(
    public modalController: ModalController,
    public appGlobalService: AppGlobalService,
    public pageModalService: PageModalService
  ) { }

  ngOnInit() {}
  onCancelClick(e) {
    e.stopPropagation();
  }
  dismissClick() {
    this.modalController.dismiss();
  }

  back() {
    this.modalController.dismiss();
  }
  changeAccount(item){
    if (item.link) {
      this.pageModalService.openPage(item.link);
    } else {
      this.modalController.dismiss (item);
    }

  }
}
